package com.hyt.model.cloudefile.enums;

import org.apache.commons.lang3.StringUtils;

import lombok.Getter;

/**
 * 系统枚举
 * @author huangwu
 */
@Getter
public enum OperateTypeEnum {

	FILE_UPLOAD("1", "文件上传"),
	FILE_DOWNLOAD("2", "文件下载"),
	FILE_GENERATE("3", "文件生成"),
    

    ;
    /**
     * 操作类型
     */
    private final String operateType;
    /**
     * 描述信息
     */
    private final String operateDesc;
	private OperateTypeEnum(String operateType, String operateDesc) {
		this.operateType = operateType;
		this.operateDesc = operateDesc;
	}
    
	public static OperateTypeEnum getOperateTypeEnumByType(String type) {
		if(StringUtils.isEmpty(type)) {
			return null;
		}
		for (OperateTypeEnum operateTypeEnum : OperateTypeEnum.values()) {
			if(operateTypeEnum.getOperateType().equals(type)) {
				return operateTypeEnum;
			}
		}
		return null;
	}
}
